package org.hfy.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 供应商实体类
 * 
 * @author hfy
 * @version 1.0
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("suppliers")
public class Supplier extends BaseEntity {

    /**
     * 供应商代码
     */
    @NotBlank(message = "供应商代码不能为空")
    @Size(max = 20, message = "供应商代码长度不能超过20个字符")
    @TableField("supplier_code")
    private String supplierCode;

    /**
     * 供应商名称
     */
    @NotBlank(message = "供应商名称不能为空")
    @Size(max = 50, message = "供应商名称长度不能超过50个字符")
    @TableField("supplier_name")
    private String supplierName;

    /**
     * 供应商类型(material:原材料,equipment:设备,service:服务,other:其他)
     */
    @NotBlank(message = "供应商类型不能为空")
    @TableField("supplier_type")
    private String supplierType;

    /**
     * 联系人姓名
     */
    @NotBlank(message = "联系人姓名不能为空")
    @Size(max = 30, message = "联系人姓名长度不能超过30个字符")
    @TableField("contact_name")
    private String contactName;

    /**
     * 联系人电话
     */
    @NotBlank(message = "联系人电话不能为空")
    @Size(max = 20, message = "联系人电话长度不能超过20个字符")
    @TableField("contact_phone")
    private String contactPhone;

    /**
     * 地址
     */
    @TableField("address")
    private String address;

    /**
     * 状态(active:启用,inactive:停用)
     */
    @TableField("status")
    private String status;
} 